public class Num2180 {
    public int countEven(int num) {
        int count = 0;
        for (int i = 1; i <= num; i ++){
            if (isOu(i)) count++;
        }
        return count;
    }
    public boolean isOu(int num) {
        int sum = 0;
        while (num > 0) {
            sum += num % 10;
            num /= 10;
        }
        return sum % 2 == 0 ? true : false;
    }
}
